﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ViewModel
{
    /// <summary>
    /// 用户视图模型
    /// </summary>
    class UserVM
    {
        public Guid UserID { get; set; }
        public string username { get; set; }
        public string userpassword { get; set; }
        public string StuNo { get; set; }
        public string name { get; set; }
        public bool Gender { get; set; }
        public string GenderString { get; set; }//性别字符串
        public string IDNumber { get; set; }
        public DateTime CreateDate { get; set; }
        public string Email { get; set; }
        public string Moblie { get; set; }
        public string Address { get; set; }
        public string URL { get; set; }
        //关联关系成员定义
        public Guid RoleID { get; set; }
        public string RoleName { get; set; }
        public Guid ClassID { get; set; }
        public string ClassName { get; set; }
        public UserVM()
        {
            this.UserID = this.RoleID = this.ClassID = Guid.NewGuid();
            this.Gender = true;
            if (this.Gender)
                this.GenderString = "男";
            else
                this.GenderString = "女";
            this.CreateDate = DateTime.Now;
        }
        public UserVM(UserVM vm)
        {
            this.UserID = vm.UserID;
            this.username = vm.username;
            this.userpassword = vm.userpassword;
            this.StuNo = vm.StuNo;
            this.name = vm.name;
            this.Gender = vm.Gender;
            if (this.Gender)
                this.GenderString = "男";
            else
                this.GenderString = "女";
            this.IDNumber = vm.IDNumber;
            this.CreateDate = vm.CreateDate;
            this.Email = vm.Email;
            this.Moblie = vm.Moblie;
            this.Address = vm.Address;
            this.URL = vm.URL;
        }
    }
}
